A direct-current (DC) LED lamp must be equipped with a rectifier circuit or a power converter to convert an alternating current (AC) power supply into a DC power supply for the LED. Since the rectifier circuit as well as the power converter requires a large capacitor and a larger printed circuit board, the resultant DC LED lamp is bulky and expensive. On the other hand, an AC LED lamp typically includes a resistor connected in series between an AC power supply and LEDs oriented in two opposite directions, in which the LEDs in one direction is lit up during the positive half cycle of the AC power supply, and the LEDs in the other direction is lit up during the negative half cycle of the AC power supply. Since only one resistor is needed, an AC LED lamp has smaller volume and lower cost than its DC counterpart. However, for an AC LED lamp, an AC power supply is directly applied to the LEDs, a surge of the AC power supply may damage or even burn the LEDs. In particular, when a commercial AC power supply is subjected to unstable voltage, such as when power resumes after failure or when voltage resumes from a transient voltage drop, a transient high voltage tends to occur and may easily burn the LEDs. Presently, the only solution is to limit the maximum value of LED current by means of a series resistor having high resistance, but this approach has its defects. Firstly, the series resistor consumes a large percentage of power and therefore generates a lot of heat. Secondly, a dilemma takes place due to the fact that the brightness of LEDs is determined by their drive current. More specifically, if a series resistor having higher resistance is used, a better protection will nevertheless result in lower LED current such that the resultant LED lamp operates at lower efficiency. On the contrary, if the series resistor has lower resistance, the LED current will increase, but the LEDs are more likely to be burned out. In addition, as a series resistor lacks adaptability, and the LED current varies with the power supply voltage and the electric properties of the LEDs, it will be very difficult to determine the resistance of the series resistor to be used. Moreover, now that the LED current varies with the power supply voltage, it is impossible to control the brightness of the LED lamp.